﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Snooze.Model
{
    using Castle.ActiveRecord;

    [ActiveRecord]
    public class AppConfig : Persistent
    {
        #region members
        private int volume = 80;
        private IList<Person> persons;
        #endregion

        #region public persistent properties
        [Property]
        public int Volume
        {
            get { return volume; }
            set { volume = value; }
        }
        #endregion

        #region public members
        
        public IList<Person> Persons
        {
            get
            {
                if (persons == null)
                {
                    persons = Repository<Person>.FindAll();
                }
                return persons;
            }
        }
        public DateTime CurrentTime
        {
            get
            {
                return DateTime.Now;
            }
        }
        #endregion
    }
}
